package com.sdlg.controller;

import com.sdlg.pojo.BookGroup;
import com.sdlg.service.BookGroupService;
import com.sdlg.util.PageResult;
import com.sdlg.util.QueryPageBean;
import com.sdlg.util.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/bookgroup")
public class BookGroupController {

    @Resource
    private BookGroupService bookgroupService;

    @RequestMapping("/saveGroupInfo")
    public Result saveGroupInfo(@RequestBody BookGroup bookgroup, Integer[] ids){
        Result result=bookgroupService.saveGroupInfo(bookgroup,ids);
        return result;
    }

    @RequestMapping("/findPageInfo")
    public PageResult findPageInfo(@RequestBody QueryPageBean queryPageBean){
        PageResult pageresult=bookgroupService.findPageInfo(queryPageBean);
        return pageresult;
    }

    @RequestMapping("/deleteInfoById")
    public Result deleteInfoById(@RequestParam("id")Integer id){
        Result result=bookgroupService.deleteInfoById(id);
        return result;
    }

    //根据项目id 查询该项目对应的多个指标id
    @RequestMapping("/getCheckitemids")
    public Result getCheckitemids(Integer id){
        Result result=bookgroupService.getCheckitemids(id);
        return result;
    }


}

